﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MedicalCare.EntityDefinitions.Entities;
using MedicalCare.Messages;
using MedicalCare.Utilities;

namespace MedicalCare.Translator
{
    public class FamilyListToScheduleList : IFamilyListToScheduleList
    {
        public List<ScheduleEntity> Translate(IList<FamilyEntity> familyList)
        {
            var scheduleList = new List<ScheduleEntity>();
            if (familyList != null)
            {
                foreach (var familyEntity in familyList)
                {
                    scheduleList.Add(new ScheduleEntity()
                                         {
                                             FamilyId = familyEntity.Id,
                                             FamilyName = familyEntity.Name,
                                             StartDT = DateTime.MinValue,
                                             EndDT = DateTime.MinValue,
                                             NurseId = -1,
                                             Status = StatusTypes.TODO.ToString(),
                                             Address = familyEntity.City
                                                       + familyEntity.District + familyEntity.AddressDetail
                                         });
                }
            }
            return scheduleList;
        }
    }
}
